package numericalSim;

import java.util.ArrayList;

import simulationSupport.WaterTempSpot;
import simulationSupport.WorldModel;

public class SimulationController {
	
	public static void simulate(double minWeight , double variation,int iterations,int maxGrowthY )
	{
		WorldModel.minWeigth = minWeight;
		WorldModel.increment = variation;
		
		PredatorModel pred1 = new PredatorModel(100, 150,"Great Barracuda");
		PredatorModel pred2 = new PredatorModel(50, 80,"Big Snapper");
		PredatorModel pred3 = new PredatorModel(200, 250,"Big Angry Shark");
		PredatorModel pred4 = new PredatorModel(30, 40,"Angry little catfish");
		WorldModel.preds = new ArrayList<PredatorModel>();
		WorldModel.preds.add(pred1);
		WorldModel.preds.add(pred2);
		WorldModel.preds.add(pred3);
		WorldModel.preds.add(pred4);
		
		WorldModel.water = new WaterModel(20, 1000, 1000);
		
		WorldModel.flock1 = new GroupModel();
		WorldModel.flock1.addStartingIndividual(24, 'M', 100, 130);
		WorldModel.flock1.addStartingIndividual(24, 'M', 100, 130);
		WorldModel.flock1.addStartingIndividual(24, 'F', 100, 130);
		WorldModel.flock1.addStartingIndividual(24, 'F', 100, 130);
		
		
		for(int it = 0;it<iterations;it++)
		{
			System.out.println("Iteration: "+it);
			WorldModel.flock1.updateFlock(WorldModel.preds, WorldModel.water.getVars());
			System.out.println(WorldModel.flock1.getFlockSize());
			System.out.println(WorldModel.flock1.getX()+","+WorldModel.flock1.getY());
		}
		/*
		System.out.println(WorldModel.flock1.getFlockSize());
		WorldModel.flock1.updateFlock(WorldModel.preds, WorldModel.water.getVars());
		System.out.println(WorldModel.flock1.getFlockSize());
		System.out.println(WorldModel.flock1.getFishBorn());
		System.out.println(WorldModel.flock1.getCasualities());
		*/

		/*
		for(WaterTempSpot ts : WorldModel.water.getVars())
		{
			System.out.println(ts.getX()+","+ts.getY()+" = "+ ts.getVariation());
	
		}
		*/
		/*
		for (int k= 0;k<iterations;k++)
		{
			
			for(PredatorModel p : WorldModel.preds)
			{
				p.updateHeadings();
				p.calculateNewCoordinates();
				System.out.println(p.getName() + " At "+ p.getX()+","+p.getY());
				
			}
			System.out.println("-");
			
		}
		*/
		
	}
	

}
